package com.team1.supervend.domain;

public class CashPayment {
	private Money amount;
	boolean preValidated = false;
	
	public CashPayment( Money cashTendered ) { 
		this.amount = cashTendered; 
		} 
	
	public Money getAmount( ) { return amount; } 

	public Money increaseAmount( Money moreCashTendered )
	{
		amount.setMoney(amount.getMoney() + moreCashTendered.getMoney());
		return amount; 
	} 

	public Money reduceAmount( Money returnedCash )
	{
		amount.setMoney(amount.getMoney() - returnedCash.getMoney());
		return amount; 
	} 
	
	public boolean preValidateCashPayement( )
	{
		if ( amount.getMoney() > 0.0f ){
			preValidated = true;
		}
		return preValidated; 
	} 
}
